<template>
  <div>
    <Result
      v-if="success"
      type="success"
      isSuccess="success"
      title="提交成功"
      description="我们将在1-2个工作日内完成初审，初审结果将会通过邮件形式告知，请注意查收。"
      class="result"
    ></Result>
    <div v-if="success" class="a-sty">
      <a-button type="primary" @click="closePage">关闭页面</a-button>
    </div>

    <Result v-if="!success" title="激活失败" class="result" description="授权办理人姓名，身份证不匹配"></Result>
    <div v-if="!success" class="a-sty">
      <a-button type="primary" @click="goPage(4)">重新填写</a-button>
    </div>
  </div>
</template>
<script>
import Result from "@/components/result/Result";

export default {
  data() {
    return {
      success: true
    };
  },
  components: {
    Result
  },
  created() {
    let pass = this.$route.query.pass;
    console.log(this.$route.query);
    console.log("pass", typeof pass, pass);
    if (pass) {
      this.success = true;
    } else {
      this.success = false;
    }
  },
  methods: {
    doNext(step) {
      console.log(step);
      var st = step + 1;
      this.$router.push("/SpeCustomer/step" + st);
    },
    goPage(step) {
      console.log(step);
      var st = step - 1;
      this.$router.push({
        path: "/SpeCustomer/step" + st,
        query: { modify: true }
      });
    },
    closePage() {
      if (
        navigator.userAgent.indexOf("Firefox") != -1 ||
        navigator.userAgent.indexOf("Chrome") != -1
      ) {
        window.location.href = "about:blank";
        window.close();
      } else {
        window.opener = null;
        window.open("", "_self");
        window.close();
      }
      //    this.$router.push("/SpeCustomer/step"+st);
    }
  }
};
</script>
<style  scoped>
.a-sty {
  text-align: center;
}
</style>
